package com.luomo.wenyuan.modules.wenyuan.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.luomo.wenyuan.common.utils.PageUtils;
import com.luomo.wenyuan.modules.wenyuan.dao.TBorrowDao;
import com.luomo.wenyuan.modules.wenyuan.entity.TBorrowEntity;
import com.luomo.wenyuan.modules.wenyuan.service.TBorrowService;
import com.luomo.wenyuan.common.utils.Query;
import org.springframework.stereotype.Service;

import java.util.Map;


@Service("tBorrowService")
public class TBorrowServiceImpl extends ServiceImpl<TBorrowDao, TBorrowEntity> implements TBorrowService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Object status = params.get("status");
        IPage<TBorrowEntity> page = this.page(
                new Query<TBorrowEntity>().getPage(params),
                new QueryWrapper<TBorrowEntity>()
                .eq(status != null,"status",status)
        );

        return new PageUtils(page);
    }

}